import { request } from "@/utils/service"
import type * as Login from "./types/login"
import {generateUUID} from "@/utils/index"
/** 获取登录验证码 */
export function getLoginCodeApi() {
  return `/api/bg/captcha?t=${generateUUID()}`
}

/** 登录并返回 Token */
export function loginApi(data: Login.LoginRequestData) {
  return request({
    url: "/bg/login",
    method: "post",
    data
  })
}

/** 获取用户详情 */
export function getAuth() {
  return request({
    url: "/bg/getAuth",
    method: "get"
  })
}

export function modifyPassword(data: any) {
  return request({
    url: "/bg/admin/modifyPassword",
    method: "post",
    data
  })
}
